#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<stdlib.h>

//const char* newenv = "myVAL=66666666666";

char *const env[]={
    (char*const)"MYVAL=666666666",
    NULL
};
int main()
{
    
    printf("main()\n");
    
    if(fork()==0)
    {
        
        printf("mypid = %d\n",getpid());
        sleep(1);

        char *const argv[] = {
            (char*const)"ls",
            (char*const)"-l",
            (char*const)"-a",
            NULL
        };

        //putenv(newenv);


        //execvpe("")
        //execvp(argv[0],argv);
        //execv("/user/bin/ls",argv);


        //execlp("ls","ls","-a","-l",NULL);
        //execl("/user/bin/ls","/user/bin/ls","-l",NULL);
        exit(1);
    }
    
    waitpid(-1,NULL,0);
    //int n = execl("/user/bi/ls","ls","-l","-a",NULL);
    //printf("success! n:%d \n",n);
    printf("success!\n");
    return 0;

}
